package com.guaju.yueshangLife.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.guaju.yueshangLife.R;

public class GoodsDetailTag extends LinearLayout {

    private LayoutInflater inflater;
    private TextView tag;

    public GoodsDetailTag(Context context) {
        super(context);
        inflater = LayoutInflater.from(context);
        init();
    }

    private void init() {
        View inflate = inflater.inflate(R.layout.tag_goods_detail, this);
        tag = inflate.findViewById(R.id.tag_sale);

    }

    public GoodsDetailTag(Context context,  @Nullable AttributeSet attrs) {
        super(context, attrs);
        inflater=LayoutInflater.from(context);
        init();
        TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.goods_detail_tag);
        String tagName = typedArray.getString(R.styleable.goods_detail_tag_tagname);
        tag.setText(tagName);
    }

    public void setTagName(String tagName){
        tag.setText(tagName);
    }
}
